﻿using System;

namespace Liphofra.Mvvm.ViewModels
{
    /// <summary>
    /// Describes a factory that can be used to create view models.
    /// </summary>
    public interface IViewModelFactory
    {
        /// <summary>
        /// Creates and pre-configures a view model of the given type.
        /// </summary>
        /// <param name="type">The type of the view model to create.</param>
        /// <returns>A newly created, pre-configured view model.</returns>
        object CreateViewModel(Type type);

        /// <summary>
        /// Creates and pre-configures a view model of the given type.
        /// </summary>
        /// <typeparam name="T">The type of the view model to create.</typeparam>
        /// <returns>A newly created, pre-configured view model.</returns>
        T CreateViewModel<T>() where T : class;
    }
}